// 滚动区域 城市页面 
//better-scroll使用：1.找到dom节点 2.两层结构 3.实例化并插入指定节点
<template>
  <div class="scroll-wrapper" ref="wrapper">
    <div class="scroll-content">
      <!-- 当前城市组件 -->
      <current-city></current-city>
      <!-- 子组件 每一项城市 -->
      <city-list></city-list>
    </div>
  </div>
</template>

<script>
import BetterScroll from "better-scroll";
import CurrentCity from "./CityList/CurrentCity";
import CityList from "./CityList/Index";

export default {
  name: "CityScrollWrapper",
  // 组件挂载完毕后
  mounted: function () {
    this.scroll = new BetterScroll(this.$refs.wrapper);
  },
  components: {
    CurrentCity: CurrentCity,
    CityList: CityList,
  },
};
</script>

<style lang="scss" scoped>
@import "~styles/mixins.scss";
@import "~styles/variables.scss";

.header {
  @include flex-row;
  height: $headerHeight;
  background-color: $defaultBgColor;
}
</style>